<table class='table table-striped text-light' ng-hide='!!user'>
  <thead>
    <tr><th>Nick</th><th>E-Mail</th>
      <th><span ng-show='config.teams'>Team</span>
        <span ng-hide='config.teams'>Solves</span></th>
    </tr>
  </thead>
  <tbody>
    <tr ng-repeat='user in users'>
      <td><a ng-href='/admin/users/{{user.uid}}'>{{user.nick}}</a>
        <span class='ng-hide' ng-show='user.admin'>(Admin)</span></td>
      <td><a ng-href='mailto:{{user.email}}'>{{user.email}}</a></td>
      <td><a
          ng-href='/admin/teams/{{user.team_tid}}'
          ng-show='config.teams && user.team'>{{user.team.name}}</a>
        <span class='ng-hide' ng-hide='config.teams'>{{user.team.solves}}</span></td>
    </tr>
  </tbody>
</table>
<div class='row ng-hide' ng-show='!!user'>
  <div class='col-md-5 col-md-offset-2'>
    <form ng-submit='updateUser()'>
      <div class='form-group'>
        <label for='nick'>Nick</label>
        <input id='nick' name='nick' class='form-control'
          ng-model='user.nick'>
      </div>
      <div class='form-group'>
        <label for='email'>Email</label>
        <input id='email' name='email' readonly class='form-control'
          ng-model='user.email'>
      </div>
      <div ng-show='config.teams && user.team'>
        <div class='form-group'>
          <label for='team'>Team</label>
          <input id='team' name='team' readonly class='form-control'
            ng-model='user.team.name'>
        </div>
      </div>
      <div class='checkbox'>
        <label>
          <input type='checkbox' name='admin' value='True'
            ng-model='user.admin'>Admin
        </label>
      </div>
      <input type='submit' value='Save' class='btn btn-primary'>
    </form>
    <!-- TODO: solve table -->
  </div>
</div>
